UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hVyXLE44F9iI6c8lIcAElPuz7FhmVPrz02RMLJsb3UQ='
WHERE
key_id = '6c5554ef16692ab09d49a3f5060602263e17988ea6a9c12ed7f0a49f7505ceb4'
AND (
token = 'hVyXLE44F9iI6c8lIcAElPuz7FhmVPrz02RMLJsb3UQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)