UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Kxj0l8IkT4KiTKG+0GS0RDR/REr45V9ZKM2UV7Gl6A='
WHERE
key_id = '861adf21f1fdc6da38473f2835684ecaaba4b25afc76ed5e39a0d62d9c2eacaf'
AND (
token = '9Kxj0l8IkT4KiTKG+0GS0RDR/REr45V9ZKM2UV7Gl6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)