UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tuvC0hD9rEYkEkpQ/BJGp0/uvJrip4owufDFGMRrBIo='
WHERE
key_id = '7322425ccb6edd2473e74a18790f0b7c4552a9ed498add5cdc9677016f642a00'
AND (
token = 'tuvC0hD9rEYkEkpQ/BJGp0/uvJrip4owufDFGMRrBIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)