UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cml5HEV6HsUAq9SAaHHlbn008tmwfLrxQE4vFxZdck0='
WHERE
key_id = '76df9ba47c6ee9c40f284ebe59a1fc2a8aac4038dbc0a1b3b942f0581de63ccc'
AND (
token = 'Cml5HEV6HsUAq9SAaHHlbn008tmwfLrxQE4vFxZdck0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)