UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EuAP5GbJ5+JdfPdPlPOb7GerHOvJjIQuBHX1q+3pbqI='
WHERE
key_id = 'e0d543d83b603db1b24f6666b4c8e3991f8259d91974d276af45d587f74644c9'
AND (
token = 'EuAP5GbJ5+JdfPdPlPOb7GerHOvJjIQuBHX1q+3pbqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)