UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UCeZC2US2BH8whk/RBxXk9+k/p92ymuBNQeYIPz+LgY='
WHERE
key_id = '6e14148f8baf98395abbcc3ecd032e74de5b0667c6df48b1b86b0dcd478a27f7'
AND (
token = 'UCeZC2US2BH8whk/RBxXk9+k/p92ymuBNQeYIPz+LgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)