UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/D2a2pBY8n5TlbdK1Yx/ZlVgxZY4tgIFXtTuzSr7rs='
WHERE
key_id = '0dcdfdeb15a850012fbeaffa1100a35f0892871b0cefb399edf6f62b2990f5e8'
AND (
token = 'Q/D2a2pBY8n5TlbdK1Yx/ZlVgxZY4tgIFXtTuzSr7rs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)