UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44L9219WTBqJX/KwlN+Bv+QK7ADpUfkH6atx+dqvNPY='
WHERE
key_id = '57eb26fb352cd5efe68af4e94bf416323032fab097f317b2ce88372ca927b068'
AND (
token = '44L9219WTBqJX/KwlN+Bv+QK7ADpUfkH6atx+dqvNPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)