UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lFt6mY2vCvWlJym1ZxaXou+wvb/OuJyySn8Inuk0kfA=' 
WHERE 
  key_id = '28542cd8b4d937ec724d6f419039bb382504d32e5876057cb58249de221d2173' 
  AND (
    token = 'lFt6mY2vCvWlJym1ZxaXou+wvb/OuJyySn8Inuk0kfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030