UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GvA9Ew04c1VYLNR9KOvH3xs0rFDQTSFn05ZfJlqQ9cM=' 
WHERE 
  key_id = '799c410e4a53762ac6b9b3631d29f5846f325c81002277c1b555580c94d670d5' 
  AND (
    token = 'GvA9Ew04c1VYLNR9KOvH3xs0rFDQTSFn05ZfJlqQ9cM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025