UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/XY0cTO4xeKxHgjNQSmrzP0GpKtynP13NwdspSGvPDU='
WHERE
key_id = 'c3f17fe56ca9ac1bb68f10cc0e9f45605190dd4c53cef7862655c1f6fc5e0eb0'
AND (
token = '/XY0cTO4xeKxHgjNQSmrzP0GpKtynP13NwdspSGvPDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)