UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x/lzzefAJHl/C9qqftAdmarGDsyEVEDdy2EneyZOsaI=' 
WHERE 
  key_id = '52682be8c32f615040a2a543531b59ede5565c1b1520ed754b7057b72f808795' 
  AND (
    token = 'x/lzzefAJHl/C9qqftAdmarGDsyEVEDdy2EneyZOsaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024