UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3axWj0tn+L1kN3a2kpFq88xDFDoI+9ehmlrb3Z5gIj0='
WHERE
key_id = 'a00e39daedd002e2bc7863949fbc4cfc2e40ec85bf19b71baed3168e88bdf2d3'
AND (
token = '3axWj0tn+L1kN3a2kpFq88xDFDoI+9ehmlrb3Z5gIj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)