UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rMovWKRBrfVWqHWS8hj/QUWQy5Q0VvfUS/qbzshgcYY='
WHERE
key_id = 'e1b6eb0101b7ebcbb609a91d32536b2478b29ad5f5f2cd0a9362b40600e3b87e'
AND (
token = 'rMovWKRBrfVWqHWS8hj/QUWQy5Q0VvfUS/qbzshgcYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)