UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CnFm4vcRoCYRhI82R8SZb3SmxpuDr/NkA7pkjQjiHe8='
WHERE
key_id = '7caa12728b1e1d098a3d7a074dcfb055483412b13a7b064902edd6f6f7736e8f'
AND (
token = 'CnFm4vcRoCYRhI82R8SZb3SmxpuDr/NkA7pkjQjiHe8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)