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