UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XHIPIcdN4jBho0Bu2iGPz19L4g9F75xvWdHh7nqkoeY='
WHERE
key_id = '20214222bb45f4dcd45bd88234c5f71a04f92a2c5b07ecf3d62df3127b292c1a'
AND (
token = 'XHIPIcdN4jBho0Bu2iGPz19L4g9F75xvWdHh7nqkoeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)