UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qQadrKDspzI0rZis1Jk2PFzM2id9yHMK6+yF5/ZV6Fc='
WHERE
key_id = '96a61c8f82c8f45206685830aa393f2c1462bc01187449ace56caed5b1af2b56'
AND (
token = 'qQadrKDspzI0rZis1Jk2PFzM2id9yHMK6+yF5/ZV6Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)