UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kwoeYfbTQTbY3rr53l2rN4AS4oJ2xdfNy5+2OiZEFTA=' 
WHERE 
  key_id = '0ae6d6c018aa6034af0d727c2f79bc6102f722d90889d68ba08e1f91642dd048' 
  AND (
    token = 'kwoeYfbTQTbY3rr53l2rN4AS4oJ2xdfNy5+2OiZEFTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038