UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FcUcUMGtU3XmhI9UpXtA6+yIRX7h1hhEIfwE6dDtKjE='
WHERE
key_id = 'd70725d233f52fb9dc1bf00d2cf3013933b4da9d89a47b87735901e9cb9e74cf'
AND (
token = 'FcUcUMGtU3XmhI9UpXtA6+yIRX7h1hhEIfwE6dDtKjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)