UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7j6yQI+DDmy3T5EwBI6yvZgH3yWyr33XPW0VGWuKDjM=' 
WHERE 
  key_id = '22379b4306899e9a7a51695954fe9a8dc131032015985e7c5a1e774b7615429f' 
  AND (
    token = '7j6yQI+DDmy3T5EwBI6yvZgH3yWyr33XPW0VGWuKDjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039