UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4t0w+ZCXhh3VnjCmuOHVON5ecl7SaZAT/TB0vz2ReSU='
WHERE
key_id = '202875817f49683f6bbb111d1ce0c14860dc28d4209806ef715a8217e43865c5'
AND (
token = '4t0w+ZCXhh3VnjCmuOHVON5ecl7SaZAT/TB0vz2ReSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)