UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E6MwfOVgnt+MjitftLU/k/UJ2JlFagB3h7+9FKOYeUU='
WHERE
key_id = '7288dd68d5d1f7e5faf27df5bb9c0a1b5d2d3f87845146fdc3f5550dd1101b69'
AND (
token = 'E6MwfOVgnt+MjitftLU/k/UJ2JlFagB3h7+9FKOYeUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)