UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UuqngNkBrt3BPPRGLJcgFhGvJexZFD75nQKa2KJs6iU='
WHERE
key_id = '568d6f3ba35bd2b69e24f6e14d2a3867daf2569697073df3df3f5ed5a2699ca6'
AND (
token = 'UuqngNkBrt3BPPRGLJcgFhGvJexZFD75nQKa2KJs6iU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)