UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9U7mVghC3uJJDLeu2lc7JB/yHPbYYWLJOWCrfz0xFx4='
WHERE
key_id = '85ea9b12ae779768c6f86c507322e35c4f4f5aa8309a334c188978fd13c41627'
AND (
token = '9U7mVghC3uJJDLeu2lc7JB/yHPbYYWLJOWCrfz0xFx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)