UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/veiB6NzLmcpOb4MIhS7l9OuO4ox49BMOeL9B2Ct+8Y=' 
WHERE 
  key_id = 'a6922cf26a53453e03964555ba4488b56a254ac44a8eb4a7f4def3548bce2196' 
  AND (
    token = '/veiB6NzLmcpOb4MIhS7l9OuO4ox49BMOeL9B2Ct+8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047