UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rf2GqFlckVXUDpQJGbXaleO1suNg0FBjx4Bvr0lVSEo=' 
WHERE 
  key_id = '374cfd321bca07ab6b7389e5d6fbf00ccc18419cd91fb8d436f8969c8246b307' 
  AND (
    token = 'Rf2GqFlckVXUDpQJGbXaleO1suNg0FBjx4Bvr0lVSEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025