UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LAKuUv+/NlGd2SMuHKd0JoTtbkWmuXo6y6NRk/mcJkc=' 
WHERE 
  key_id = '70753e0ec895cffb7851baaaea2f9c054961b6352608b5eeb470e59c0df29133' 
  AND (
    token = 'LAKuUv+/NlGd2SMuHKd0JoTtbkWmuXo6y6NRk/mcJkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041