UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nVzZYC/lUvkb0nwC9WV6ukirL0sHb4L5CLwOrIeMTjA='
WHERE
key_id = '2b89b13230c0af6f38a6f57709ff32f02ba7e97815fec6aa5142a269d2869283'
AND (
token = 'nVzZYC/lUvkb0nwC9WV6ukirL0sHb4L5CLwOrIeMTjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)