UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xmIjawklTwXWyDnqNzyQ3TCdRpolAlebhz9WeCyCGOc=' 
WHERE 
  key_id = 'faca25177fed21781b70963e169f2129aab6f68136f83fef8938c725f45e6a2e' 
  AND (
    token = 'xmIjawklTwXWyDnqNzyQ3TCdRpolAlebhz9WeCyCGOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022