UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GJjyVcdWwiEO9oUEr/nqrzxV0V8q3Jli+nJm7LGW41k='
WHERE
key_id = 'f9f92984c6aaa91011ce33d207cd40245013de9b6a276a965cbd1c0fd62a71b3'
AND (
token = 'GJjyVcdWwiEO9oUEr/nqrzxV0V8q3Jli+nJm7LGW41k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)