UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u+eTg7aG1X+g0vta6NOVWmkJiepYvw7PIn62e2ENYbQ='
WHERE
key_id = 'f1be29691e408cecb6426ad7c6ec73a29ddd58380ab5cc66b6a0f5fa068c23d7'
AND (
token = 'u+eTg7aG1X+g0vta6NOVWmkJiepYvw7PIn62e2ENYbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)