UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VVPbhru0tWBr8eWODZZe9YgancUPJlTCSamXBkT3epI=' 
WHERE 
  key_id = 'd3ec911a9445c441c707060b8eeedb5d0115148e57bf10f7384146d1370ae432' 
  AND (
    token = 'VVPbhru0tWBr8eWODZZe9YgancUPJlTCSamXBkT3epI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029