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