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