UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wpx9DN6MwrlRV3xGAFXC4RrFvAUOkw13p2E4maKuPBo='
WHERE
key_id = 'cea29b6720d6cc4ec124c5056f154fec42979e748ac0ae1083a040beb2a23f32'
AND (
token = 'wpx9DN6MwrlRV3xGAFXC4RrFvAUOkw13p2E4maKuPBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)