UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qoOBKEP5HWvx+H0VqTPTXFqaNrTnR7dGUNEC/atSlO4='
WHERE
key_id = '2e434a10378e18b7de3c85cee1c67993861bc3f1dac4c635507087f8912168d7'
AND (
token = 'qoOBKEP5HWvx+H0VqTPTXFqaNrTnR7dGUNEC/atSlO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)