UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HEwmuLHj4qxM3gdBb6TmLZrNiwU+xNQPOtUcpSBepRc='
WHERE
key_id = 'dc472443283cd9fb6d4fda3b7e19f77cc4eb09661336477fc2eb99e3db87c83b'
AND (
token = 'HEwmuLHj4qxM3gdBb6TmLZrNiwU+xNQPOtUcpSBepRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)