UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mvnAnPkDTJ19kY0yD+/jWNs0MR6/AY1g5PkbNtXcesA='
WHERE
key_id = '277c53175ad37d0786ae94120654e586caf18f7a10b2b0da5a644132c82a7ad5'
AND (
token = 'mvnAnPkDTJ19kY0yD+/jWNs0MR6/AY1g5PkbNtXcesA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)