UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UwdRaSjjNXMGlQFRu/4nGNXyRTAuw2LuEFeBMoiiho='
WHERE
key_id = '1702143d31d701a32736f36f6db252aa1e917f01bd309fce6d4fc2b7f01fa35f'
AND (
token = '4UwdRaSjjNXMGlQFRu/4nGNXyRTAuw2LuEFeBMoiiho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)