UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hi8LslebYemCbt8vmj6LsnrCP7TZklNvJ1dbW7JdSrQ='
WHERE
key_id = 'f89cd395ea441e9211093401f6568eff81102fc3d0dd21e33bb2c4b45bf82d87'
AND (
token = 'Hi8LslebYemCbt8vmj6LsnrCP7TZklNvJ1dbW7JdSrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)