UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'njsV7e4hR6bjAtIpoW5sRWcu9vD7sLIdOJ4AJcYXzGk='
WHERE
key_id = '021b790605417119e3b5a20d48ceb145b7a80be93b5bb0323dbde1cc45af2d24'
AND (
token = 'njsV7e4hR6bjAtIpoW5sRWcu9vD7sLIdOJ4AJcYXzGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)